﻿@{
	ViewBag.Title = "Escalar Times";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
	@ViewBag.Title</h2>
@using (Html.BeginForm())
{
	@Html.ValidationSummary(true)

	<fieldset>
		@Html.Hidden("JogoGrupoId", (int)ViewBag.JogoGrupoId)
		<legend>Escalação</legend>
		<div class="div_mandante_titular">
			<fieldset>
				<legend>Mandante - Titulares</legend>
				@for (int i = 0; i < 11; i++)
	{
		List<ChampionFramework.Models.Jogador> l = (List<ChampionFramework.Models.Jogador>)ViewBag.JogadoresMandante;
		SelectList sl = new SelectList(l, "Id", "Nome", l[i].Id.ToString());
		//string itemId = l[i].Id.ToString();
		//sl.Single(sli => sli.Value == itemId).Selected = true;
					@Html.DropDownList(String.Format("JogadoresTitularesMandante{0}", i), sl);
	}
			</fieldset>
		</div>
		<div class="div_visitante_titular">
			<fieldset>
				<legend>Visitante - Titulares</legend>
				@for (int i = 0; i < 11; i++)
	{
		List<ChampionFramework.Models.Jogador> l = (List<ChampionFramework.Models.Jogador>)ViewBag.JogadoresVisitante;
		SelectList sl = new SelectList(l, "Id", "Nome", l[i].Id.ToString());
		//string itemId = l[i].Id.ToString();
		//sl.Single(sli => sli.Value == itemId).Selected = true;
					@Html.DropDownList(String.Format("JogadoresTitularesVisitante{0}", i), sl);
	}
			</fieldset>
		</div>
		<div class="clear_both" />
		<div class="div_mandante_reserva">
			<fieldset>
				<legend>Mandante - Reservas</legend>
				@for (int i = 0; i < 7; i++)
	{
		List<ChampionFramework.Models.Jogador> l = (List<ChampionFramework.Models.Jogador>)ViewBag.JogadoresMandante;
		SelectList sl = new SelectList(l, "Id", "Nome", l[i].Id.ToString());
		//string itemId = l[i + 11].Id.ToString();
		//sl.Single(sli => sli.Value == itemId).Selected = true;
					@Html.DropDownList(String.Format("JogadoresReservasMandante{0}", i), sl);
	}
			</fieldset>
		</div>
		<div class="div_visitante_reserva">
			<fieldset>
				<legend>Visitante - Reservas</legend>
				@for (int i = 0; i < 7; i++)
	{
		List<ChampionFramework.Models.Jogador> l = (List<ChampionFramework.Models.Jogador>)ViewBag.JogadoresVisitante;
		SelectList sl = new SelectList(l, "Id", "Nome", l[i].Id.ToString());
		//string itemId = l[i + 11].Id.ToString();
		//sl.Single(sli => sli.Value == itemId).Selected = true;
					@Html.DropDownList(String.Format("JogadoresReservasVisitante{0}", i), sl);
	}
			</fieldset>
		</div>
		<div class="clear_both" />
		<p>
			<input type="submit" value="Create" />
		</p>
	</fieldset>
}
@section Scripts {
	@Scripts.Render("~/bundles/jqueryval")
}